JFLEX  = jflex 
BYACCJ = byaccj
JAVAC  = javac
CC		 = gcc
CFLAGS = -Wall
JOPTIONS = -Xlint:none
FOPTIONS = -q
YOPTIONS = -Jnorun -Jnodebug
# targets:

all: Parser.class avlc avl

avlc: avlc.c
		$(CC) $(CFLAGS) -o avlc avlc.c

avl: avlrun.c
		$(CC) $(CFLAGS) -o avl avlrun.c

run: Parser.class
	java Parser sort.avl
	java Parser matmul.avl

build: clean Parser.class

clean:
	rm -f y.* *~ *.class Yylex.java Parser*.java Output.java avlc avl

Parser.class: Yylex.class Parser.java AVLManager.java AVLSymbolTable.java AVLFunction.java AVL.java AVLNode.java 
	$(JAVAC) $(JOPTIONS) Parser.java AVLManager.java AVLSymbolTable.java AVLFunction.java AVL.java AVLNode.java 

Yylex.class: AVL.flex
	$(JFLEX) $(FOPTIONS) AVL.flex

Parser.java: AVL.y
	$(BYACCJ) $(YOPTIONS) AVL.y 2> error.out
